<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>设置密码</title>
		<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="../css/mui.min.css">
		<script src="../js/jquery.min.js"></script>
		<script src="../js/touch.min.js"></script>
		<script src="../js/layer/layer.js"></script>
		<!-- <script src="../css/layer.css"></script> -->
		<style type="text/css">
			*{
				margin: 0rem;
				padding: 0rem;
				text-decoration: none;
				list-style: none;
				
			}
			html,body{
				background-color: #fff;
				width: 100%;
				height: 100%;
				 /*font-size:  100rem;*/
				 font-size: calc(100vw / 7.5);
				 font-family: "microsoft yahei";
			}
			/*头部*/
			.wrapper .header{
				display: flex;
				width: 100% ;
				height: 0.88rem;
				background: #809fba;
			}	
			.wrapper .header div{
				height: 100%;
				font-size: 0.30rem;
				text-align: center;
				line-height: 0.88rem;
				color: #fff;
			}
			.con{
				flex: 8;
			}
			.arrow img{
				width: 0.41rem;
				height: 0.3rem;
				display: inline-block;
			}
			.dot img{
				width: 0.41rem;
				height: 0.09rem;
				display: inline-block;
				margin-bottom: 3px;
			}
			.arrow{
				flex: 1;
				/* background: url("../img/arrow.png") no-repeat center; */
				background-size: contain;
			}
			.dot{
				flex: 1;
			}
			/*内容*/
			.content{
				position: relative;
				width: 100%;
				min-height: 10.8rem;
			}
			.content form {
				width: 100%;
			}
			.content form .info{
				box-sizing: border-box;
				height: 1rem;
				line-height: 1rem;
				font-size: 0.28rem;
				width: 96%;
				margin-left: 3%;
				color: #9a9a9a;
				border-color: #fff;
				border-bottom: 1px solid #e9f0f0;
			}
			
			.content form .sub{
				position: absolute;
				bottom: 0.8rem;
				left: 0.64rem;
				width: 6.25rem;
				height: 0.9rem;
				background: #7f9eba;
				color: #fff;
			}
			#tan{
				display: none;
				position: fixed;
				top: 50%;
				left:50%;
				width: 4.5rem;
				height: 2rem;
				background: #111;
				font-size: 0.22rem;
				opacity: 0.5;
				color: #fff;
				border: 1px solid red;
			}
		</style>
	</head>

	<body>
		<script>
			$(function(){
				$("#wrapper").load("../header.html")
				
			})
			setTimeout(function(){
				$("#wrapper").find(".con").html("设置密码").end().find(".dot img").css("display","none");
				$(".arrow").on("tap",function(){
				window.location.href = "anquanzhongxin.html";
			})
			},200)
			setTimeout(function(){
				$("#wrapper").find(".con").html("设置密码").end().find(".dot img").css("display","none");
				$(".arrow").on("tap",function(){
				window.location.href = "anquanzhongxin.html";
			})
			},2000)
		</script>
		
		<div class="wrapper" id="wrapper"></div>
		<div class="content">
			<form action="#" method="post">
				<input type="password" name="nicheng" class="info" id="old_password" placeholder="请输入原密码"/>
				<input type="password" name="nicheng" class="info" id="new_password"  placeholder="请输入新密码"/>
				<input type="password" name="nicheng" class="info" id="verify_password"  placeholder="请再次输入新密码"/>
				<input type="button" class="sub" value = "确认">
			</form>
		</div>
		<!-- <div id="tan"> 我很美</div> -->
	
	
		
		<script src="../js/mui.min.js"></script>
		<script>
			$(".sub").on("click",function(){
				var old_password = $("#old_password").val();
				var new_password = $("#new_password").val();
				var verify_password = $("#verify_password").val();
		
				$.ajax({
					type: "POST",
					url: `${localStorage.top}api/UserCenter/change_password`,
					data: {
						"TOKEN": `${localStorage.token}`,
						"old_password": old_password,
						"new_password": new_password,
						"verify_password": verify_password
					},
					success: successed
				});

			})
		
			function successed(data){
				console.log(data)
				if(data.code ==localStorage.erro){
					layer.msg(data.msg)
				}else if(data.code == localStorage.success){
					layer.msg(data.msg);
					setTimeout(function(){
						window.location.href = "../te/login/login.html"
						console.log("我跳转了")
					},500)
				}
			}
		
		</script>
	</body>

</html>